//
//  ShareManager.m
//  KwSing
//
//  Created by yuchenghai on 14-9-30.
//  Copyright (c) 2014年 kuwo.cn. All rights reserved.
//

#import "ShareManager.h"

@implementation ShareManager

+ (instancetype)defaultManager {
    static ShareManager *shareMgr = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        shareMgr = [[ShareManager alloc] init];
    });
    return shareMgr;
}

- (id)init {
    self = [super init];
    if (self) {

    }
    return self;
}


- (void)shareWeiBoInBackgroundWithText:(NSString *)text withCompletion:(shareCompletionBlock)completion
{
//    NSString *weiboToken = [[LoginManager defaultManager] loginDataInfo].WeiBoToken;
//    
//    [[SinaWeiboApiManager defaultManager] shareWeiBoInBackgroundWithText:text withTocken:weiboToken withCompletion:completion];
}

// 跳到应用分享
- (void)shareWeiBoInAPPWithText:(NSString *)text withCompletion:(shareCompletionBlock)completion
{
//    NSString *weiboToken = [[LoginManager defaultManager] loginDataInfo].WeiBoToken;
//    
//    [[SinaWeiboApiManager defaultManager] shareWeiBoInAPPWithText:text withTocken:weiboToken withCompletion:completion];
}

// 跳到应用分享
- (void)shareWeiBoInAPPWithText:(NSString *)text image:(UIImage *)image withCompletion:(shareCompletionBlock)completion
{
//    NSString *weiboToken = [[LoginManager defaultManager] loginDataInfo].WeiBoToken;
//    
//    [[SinaWeiboApiManager defaultManager] shareWeiBoInAPPWithText:text withTocken:weiboToken image:image withCompletion:completion];
}

- (void)shareQQInAPP:(KSShareToQQType)shareToQQType
               title:(NSString *)title
                 url:(NSString *)url
         description:(NSString *)description
            imageUrl:(NSString *)imageUrl
            isToZone:(BOOL)toZone
      withCompletion:(shareCompletionBlock)completion
{
    if (toZone) {
        [[TencentApiManager defaultManager] shareToZoneInAPP:shareToQQType title:title url:url description:description imageUrl:imageUrl withCompletion:completion];
    } else {
        [[TencentApiManager defaultManager] shareToQQInAPP:shareToQQType title:title url:url description:description imageUrl:imageUrl withCompletion:completion];
    }
}

- (void)shareQQInAPP:(KSShareToQQType)shareToQQType
               title:(NSString *)title
                 url:(NSString *)url
         description:(NSString *)description
               image:(UIImage  *)image
            isToZone:(BOOL)toZone
      withCompletion:(shareCompletionBlock)completion
{
    if (toZone) {
        [[TencentApiManager defaultManager] shareToZoneInAPP:shareToQQType title:title url:url description:description image:image withCompletion:completion];
    } else {
        [[TencentApiManager defaultManager] shareToQQInAPP:shareToQQType title:title url:url description:description image:image withCompletion:completion];
    }
}


- (void)shareWeiXinInAPP:(KSShareToWXType)shareToWXType
                   title:(NSString *)title
                     url:(NSString *)url
                 dataUrl:(NSString *)dataUrl
             description:(NSString *)description
                   image:(UIImage *)image
             isToFriends:(BOOL)toFriends
          withCompletion:(shareCompletionBlock)completion
{
    [[WeiXinApiManager defaultManager] shareToWeixinInAPP:shareToWXType title:title url:url dataUrl:dataUrl description:description image:image toFriends:toFriends withCompletion:completion];
}

@end
